package io.xccit.controller;

import io.xccit.service.CheckoutService;
import io.xccit.service.IBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * @author Xccit
 * @Date 2023-02-01
 * @Description Book控制层
 */
@Controller
public class BookController {
    @Autowired
    private IBookService bookService;
    @Autowired
    private CheckoutService checkoutService;

    /**
     * 模拟买书
     * @param readerId
     * @param bookId
     */
    public void buyBook(Integer readerId,Integer bookId){
        bookService.buyBook(readerId,bookId);
    }
    public void checkout(Integer readerId,Integer[] bookIDs){
        checkoutService.checkout(readerId,bookIDs);
    }
}
